home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Games Galore!
/
Shareware Games Galore!.iso
/
arcade
/
gameser1
/
wumpus.bas
< prev
next >
Wrap
BASIC Source File
|
1982-02-06
|
10KB
|
373 lines
1000 PRINT TAB(10);"WUMPUS 2"
1010 PRINT " "
1020 REM - wumpus version 2
1030 DIM S(20,3)
1040 DIM L(6),M(6),P(5)
1050 PRINT "Instructions ?? (y,n);
1060 INPUT I$
1070 PRINT " "
1080 IF LEFT$(I$,1) <> "y" THEN 1110
1090 GOSUB 1640
1100 REM - choose and set up cave
1110 GOSUB 3680
1113 Q$=MID$(TIME$,7,2)
1114 Q1=CVI(Q$)
1115 RANDOMIZE(Q1)
1120 DEF FNA(X)=INT(20*RND)+1
1130 DEF FNB(X)=INT(3*RND)+1
1140 DEF FNC(X)=INT(4*RND)+1
1150 REM locate l array items
1160 REM 1-you, 2-wumpus, 3&4-pits, 5&6-bats
1170 FOR J=1 TO 6
1180 L(J)=FNA(0)
1190 M(J)=L(J)
1200 NEXT J
1210 REM - check for crossover (ie l(1)=l(2) etc)
1220 FOR J=1 TO 6
1230 FOR K=J TO 6
1240 IF J=K THEN 1260
1250 IF L(J)=L(K) THEN 1170
1260 NEXT K
1270 NEXT J
1280 REM - set # arrows
1290 A=5
1300 L=L(1)
1310 REM - run the game
1320 PRINT "Hunt the wumpus."
1330 REM-hazards warnings and location
1340 GOSUB 2410
1350 REM move or shoot
1360 GOSUB 2580
1370 ON O GOTO 1390,1430
1380 REM shoot
1390 GOSUB 2720
1400 IF F=0 THEN 1360
1410 GOTO 1450
1420 REM move
1430 GOSUB 3300
1440 IF F=0 THEN 1340
1450 IF F > 0 THEN 1500
1460 REM lose
1470 PRINT "HA HA HA - You LOOSE!!!"
1480 GOTO 1510
1490 REM win
1500 PRINT "HEE HEE HEE - The WUMPUS'LL GET YOU NEXT TIME!!!"
1510 FOR J=1 TO 6
1520 L(J)=M(J)
1530 NEXT J
1540 PRINT "Play again ?? (y/n)";
1550 INPUT I$
1560 PRINT " "
1570 PRINT " "
1580 IF LEFT$(I$,1) <> "y" THEN 4640
1590 PRINT "Same set-up ?? (y/n);
1600 INPUT I$
1610 PRINT " "
1620 IF LEFT$(I$,1) <> "y" THEN 1110
1630 GOTO 1290
1640 REM - instructions
1650 PRINT "Welcome to WUMPUS II"
1655 PRINT
1660 PRINT "This version has the same rules as"
1670 PRINT "'Hunt The WUMPUS'. However, you"
1680 PRINT "now have a choice of caves to play"
1690 PRINT "in. Some caves are easier than"
1700 PRINT "others. All caves have 20 rooms"
1710 PRINT "and 3 tunnels leading from one room"
1720 PRINT "to other rooms."
1730 PRINT "The caves are:"
1740 PRINT " 0 - DODECAHEDRON -- The rooms of this"
1750 PRINT " cave are on a 12-sided object,"
1760 PRINT " each forming a pentagon. The"
1770 PRINT " rooms are at the corners of the"
1780 PRINT " pentagons. Each room having"
1790 PRINT " tunnels that lead to 3 other rooms."
1800 PRINT " "
1810 PRINT " 1 - MOBIUS STRIP -- This cave is two"
1820 PRINT " rooms wide and 10 rooms around"
1830 PRINT " (like a belt). You will notice"
1840 PRINT " there is a half twist somewhere."
1850 PRINT " "
1860 PRINT "Press enter to continue";
1870 INPUT X$
1880 PRINT " "
1890 PRINT " 2 - STRING OF BEADS -- Five beads in"
1900 PRINT " a circle. Each bead is a diamond"
1910 PRINT " with a vertical cross-bar. The"
1920 PRINT " right & left corners lead to"
1930 PRINT " neighbouring beads. (This one is"
1940 PRINT " difficult to play)."
1950 PRINT " "
1960 PRINT " 3 - HEX NETWORK -- Imagine a hex tile"
1970 PRINT " floor. Take a rectangle with 20"
1980 PRINT " points (intersections) inside"
1990 PRINT " (4X4). Join right & left sides"
2000 PRINT " to make a cylinder. Then join"
2010 PRINT " top & bottom to form a torus"
2020 PRINT " (doughnut)."
2030 PRINT " Have fun imagining this one!!"
2040 PRINT " "
2050 PRINT " Caves 1-3 are regular in a sense that"
2060 PRINT "each room goes to three other rooms &"
2070 PRINT "tunnels allow two-way traffic. Here"
2080 PRINT "are some 'irregular' caves:"
2090 PRINT " "
2100 PRINT "Press enter to continue";
2110 INPUT X$
2120 PRINT " 4 - DENDRITE WITH DEGENERACIES --"
2130 PRINT " Pull a plant from the ground."
2140 PRINT " The roots & branches form a"
2150 PRINT " DENDRITE - ie., there are no"
2160 PRINT " looping paths. Degeneracy means"
2170 PRINT " a) some rooms connect to themselve"
2180 PRINT " and b) some rooms have more than"
2190 PRINT " one tunnel to the same other room"
2200 PRINT " ie, 12 has two tunnels to 13."
2210 PRINT " "
2220 PRINT " 5 - ONE WAY LATTICE - Here all tunnels"
2230 PRINT " go one way only. To return, you"
2240 PRINT " must go around the cave. (About"
2250 PRINT " 5 moves)."
2260 PRINT " "
2270 PRINT " 6 - ENTER YOUR OWN CAVE !! -- The"
2280 PRINT " computer will ask you the rooms"
2290 PRINT " next to each room in the cave."
2300 PRINT " For Example:"
2310 PRINT " Room #1 ? 2,3,4 -- your reply"
2320 PRINT " means room 1 has tunnels going to"
2330 PRINT " rooms 2, 3, &4."
2340 PRINT " "
2350 PRINT "Press enter to continue";
2360 INPUT X$
2370 PRINT " "
2380 PRINT "HAPPY HUNTING !!"
2390 PRINT " "
2400 RETURN
2410 REM
2420 PRINT " "
2430 FOR J=2 TO 6
2440 FOR K=1 TO 3
2450 IF S(L(1),K) <> L(J) THEN 2520
2460 ON J-1 GOTO 2470,2490,2490,2510,2510
2470 PRINT "I smell a WUMPUS !!"
2480 GOTO 2520
2490 PRINT "I feel a DRAFT !!"
2500 GOTO 2520
2510 PRINT "BATS Nearby !!"
2520 NEXT K
2530 NEXT J
2540 PRINT "You are in room ";L(1)
2550 PRINT "Tunnels lead to "S(L,1);S(L,2);S(L,3)
2560 PRINT " "
2570 RETURN
2580 REM - choose option
2590 GOTO 2630
2600 PRINT "error ";
2610 INPUT Z9
2620 PRINT " "
2630 PRINT "Shoot or move ";
2640 INPUT I$
2650 PRINT " "
2660 IF LEFT$(I$,1) <> "s" THEN 2690
2670 O=1
2680 RETURN
2690 IF LEFT$(I$,1) <> "m" THEN 2600
2700 O=2
2710 RETURN
2720 REM - arrow routine
2730 F=0
2740 REM - path of arrow
2750 GOTO 2790
2760 PRINT "error ";
2770 INPUT Z9
2780 PRINT " "
2790 PRINT "No. of rooms ";
2800 INPUT J9
2810 PRINT " "
2820 IF J9 < 1 OR J9 > 5 OR INT(J9) <> ABS(J9) THEN 2760
2830 FOR K=1 TO J9
2840 PRINT "Room #";
2850 INPUT P(K)
2860 PRINT " "
2870 IF P(K) > 0 AND P(K) < 21 AND INT(P(K))=ABS(P(K)) THEN 2920
2880 PRINT "error ";
2890 INPUT Z9
2900 PRINT " "
2910 GOTO 2840
2920 NEXT K
2930 PRINT " "
2940 REM - shoot arrow
2950 A=A-J9
2960 A9=L(1)
2970 FOR K=1 TO J9
2980 FOR K1=1 TO 3
2990 IF S(A9,K1)=P(K) THEN 3140
3000 NEXT K1
3010 REM - no tunnel for the arrow
3020 A9=S(A9,FNB(1))
3030 GOTO 3150
3040 NEXT K
3050 PRINT "Missed"
3060 REM - move wumpus
3070 GOSUB 3220
3080 REM - ammo check
3090 IF A > 0 THEN 3120
3100 PRINT "You have used ALL of your ARROWS"
3110 F=-1
3120 RETURN
3130 REM - see if arrow is at l(1) or l(2)
3140 A9=P(K)
3150 IF A9 <> L(2) THEN 3190
3160 PRINT "AHA! You got the WUMPUS! He was in room";L(2)
3170 F=1
3180 RETURN
3190 IF A9 <> L(1) THEN 3040
3200 PRINT "OUCH! Arrow got YOU!"
3210 GOTO 3110
3220 REM - move wumpus routine
3230 K=FNC(0)
3240 IF K=4 THEN 3290
3250 L(2)=S(L(2),K)
3260 IF L(2) <> L THEN 3290
3270 PRINT "TSK TSK TSK - WUMPUS Got YOU!!"
3280 F=-1
3290 RETURN
3300 REM - move routine
3310 F=0
3320 GOTO 3360
3330 PRINT "Error ";
3340 INPUT Z9
3350 PRINT " "
3360 PRINT "Where to ";
3370 INPUT L
3380 PRINT " "
3390 IF L < 1 OR L > 20 OR ABS(L) <> INT(L) THEN 3330
3400 FOR K=1 TO 3
3410 REM - check if legal move
3420 IF S(L(1),K)=L THEN 3490
3430 NEXT K
3440 IF L=L(1) THEN 3490
3450 PRINT "Not possible - ";
3460 INPUT Z9
3470 GOTO 3360
3480 REM - check for hazards
3490 L(1)=L
3500 REM - wumpus
3510 IF L <> L(2) THEN 3570
3520 PRINT "...OOPS! BUMPED A WUMPUS !"
3530 REM - move a wumpus
3540 GOSUB 3230
3550 IF F=0 THEN 3570
3560 REM - pit
3570 IF L <> L(3) AND L <> L(4) THEN 3620
3580 PRINT "YYYIIIEEEE . . . FELL IN A PIT !"
3590 F=-1
3600 RETURN
3610 REM - bats
3620 IF L <> L(5) AND L <> L(6) THEN 3670
3630 PRINT "ZAP--SUPER BAT SNATCH!"
3640 PRINT "ELSEWHERESVILLE FOR YOU!"
3650 L=FNA(1)
3660 GOTO 3490
3670 RETURN
3680 REM - select cave
3690 GOTO 3730
3700 PRINT "Error ";
3710 INPUT Z9
3720 PRINT ""
3730 PRINT "cave #(0-6) ";
3740 RESTORE
3750 INPUT N
3760 PRINT
3770 IF N<0 OR N>6 OR INT(N) <> ABS(N) THEN 3700
3780 ON N+1 GOSUB 3930,3870,3990,4110,4230,4350,4460
3790 RETURN
3800 REM - dodecahedron
3810 DATA 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
3820 DATA 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
3830 DATA 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
3840 DATA 15,17,20,7,16,18,9,17,19,11,18,20,13,16,19
3850 GOSUB 4570
3860 RETURN
3870 REM - mobius strip
3880 FOR B1=1 TO 1
3890 FOR B2=1 TO 60
3900 READ B0
3910 NEXT B2
3920 NEXT B1
3930 DATA 20,2,3,19,1,4,1,4,5,2,3,6,3,6,7
3940 DATA 4,5,8,5,8,9,6,7,10,7,10,11,8,9,12
3950 DATA 9,12,13,10,11,14,11,14,15,12,13,16,12,16,17
3960 DATA 14,15,18,15,18,19,16,17,20,2,17,20,1,18,19
3970 GOSUB 4570
3980 RETURN
3990 REM - string of beads
4000 FOR B1=1 TO 2
4010 FOR B2=1 TO 60
4020 READ B0
4030 NEXT B2
4040 NEXT B1
4050 DATA 2,3,20,1,3,4,1,2,4,2,3,5,4,6,7
4060 DATA 5,7,8,5,6,8,6,7,9,8,10,11,9,11,12
4070 DATA 9,10,12,10,11,13,12,14,15,13,15,16,13,14,16
4080 DATA 14,15,17,16,18,19,17,19,20,17,18,20,1,18,19
4090 GOSUB 4570
4100 RETURN
4110 REM - hex nut on torus
4120 FOR B1=1 TO 3
4130 FOR B2=1 TO 60
4140 READ B0
4150 NEXT B2
4160 NEXT B1
4170 DATA 6,10,16,6,7,17,7,8,18,8,9,19,9,10,20
4180 DATA 1,2,15,2,3,11,3,4,12,4,5,13,5,6,14
4190 DATA 7,16,20,8,16,17,9,17,18,10,18,19,6,19,20
4200 DATA 1,11,12,2,12,13,3,13,14,4,14,15,5,11,15
4210 GOSUB 4570
4220 RETURN
4230 REM - dendrite w/ degeneracies
4240 FOR B1=1 TO 4
4250 FOR B2=1 TO 60
4260 READ B0
4270 NEXT B2
4280 NEXT B1
4290 DATA 1,1,5,2,2,5,3,3,6,4,4,6,1,2,7
4300 DATA 3,4,7,5,6,10,8,9,9,8,8,10,7,9,11
4310 DATA 10,13,14,12,13,13,11,12,12,11,15,16,14,17,18
4320 DATA 14,19,20,15,17,17,15,18,18,16,19,19,16,20,20
4330 GOSUB 4570
4340 RETURN
4350 REM - one way lattice
4360 FOR B1=1 TO 53057! FOR B2=1 TO 60
4370 READ B0
4380 NEXT B2
4390 NEXT B1
4400 DATA 5,4,8,1,5,6,2,6,7,3,7,8,8,9,12
4410 DATA 5,9,10,6,10,11,7,11,12,12,13,16,9,13,14
4420 DATA 10,14,15,11,15,16,16,17,20,13,17,18,14,18,19
4430 DATA 15,19,20,1,4,20,1,2,17,2,3,18,3,4,19
4440 GOSUB 4570
4450 RETURN
4460 REM - input your own cave
4470 FOR J=1 TO 20
4480 PRINT "room #";J;
4490 INPUT S(J,1),S(J,2),S(J,3)
4500 FOR K=1 TO 3
4510 IF S(J,K) > 0 AND S(J,K) < 21 AND ABS(S(J,K))=INT(S(J,K)) THEN 4540
4520 PRINT "***** ERROR !!!!!"
4530 GOTO 4480
4540 NEXT K
4550 NEXT J
4560 RETURN
4570 REM - input cave
4580 FOR J=1 TO 20
4590 FOR K=1 TO 3
4600 READ S(J,K)
4610 NEXT K
4620 NEXT J
4630 RETURN
4640 END
70 REM - input cave
4580 FOR J=1 TO 20
4590 FOR K=1 TO 3